
<meta charset="utf-8">
<script>
    var year = prompt("请输入年份：");
    for(var i=1;i<=12;i++){
        if(i==4||i==6||i==9||i==11){
            document.write(year+"年"+i+"月"+30+"天<br/>");
        }else if(i==2){
            if(year%4==0 && year%100!=0 || year%400==0){
                document.write(year+"年"+i+"月"+29+"天<br/>");
            }else{
                document.write(year+"年"+i+"月"+28+"天<br/>");
            }
        }else{
            document.write(year+"年"+i+"月"+31+"天<br/>");
        }
    }
</script>